#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int Maxn = 1e5;

int n, ans;
int r[100005];
int vis[100005];
int sta[100005], spos;
set<int> s;
set<int>::iterator it;
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for (int i = 1;i <= n; ++i)
    {
        scanf("%d", r + i), ++vis[r[i]];
        if (vis[r[i]] == 1)
            s.insert(r[i]);
    }
    while (s.size() > 1)
    {
        for (it = s.begin();it != s.end(); ++it)
        {
            --vis[(*it)];
            if (vis[(*it)] == 0)
                sta[++spos] = (*it);
        }
        for (int i = 1;i <= spos; ++i)
            s.erase(sta[i]);
        spos = 0, ++ans;
    }
    for (int i = 1;i <= Maxn; ++i)
        ans += vis[i];
    printf("%d\n", ans);
    return 0;
}
